1. Field of the Invention
The present invention generally relates to dynamic image encoding apparatuses and methods for encoding a dynamic image that achieve a high encoding ratio and prevent image quality from being deteriorated by decoding and reproducing.
In order to transmit or store dynamic images, an encoding technology is desired in which a high compression rate is achieved without causing deterioration of images from reproduction. In addition, excellent recovery from a transmission error is desired. Thus, the present invention provides a dynamic image apparatus and a method for encoding a dynamic image that can realize the above technologies.
2. Description of the Related Art
Such a dynamic image encoding technology is described, for example, in ITU-T (International Telecommunication Unionxe2x80x94Telecommunication Standardization Sector) H.263, the disclosure of which is hereby incorporated for reference. This is called a dynamic image hybrid encoding method. Also, Annex K, Annex Q and Annex P are known as ITU-T H.263.
FIG. 1 is a diagram for briefly explaining ITU-T H.263 Annex Q. In FIG. 1, when a picture changes slowly, that is, when activity (motion activity) is small, an input image 41 composed of 352xc3x97288 pixels CIF (Common Intermediate Format) is divided and encoded at 16xc3x9716 pixels per macroblock (MB) so as to be encoded to an image 42. In this case, the input image 41 is divided into macroblocks of 22 columnsxc3x9718 rows and then these macroblocks are encoded with motion compensations.
When the picture changes quickly, that is, when activity is large, a large volume of information is incurred. Thus, the input image 41 is divided and encoded at 32xc3x9732 pixels per MB so as to be an image 43. In this case, the input image 41 is divided into macroblocks of 11 columnsxc3x979 rows. Then, these macroblocks, which volume is reduced to half volume, are encoded with motion compensations.
In this case, the motion compensation is performed for each macroblock composed of 32xc3x9732 pixels. Down-sampling corresponding to 16xc3x9716 pixels is performed for an estimation error of a macroblock composed of 32xc3x9732 pixels. Then, a DCT (discrete cosine transform), a quantization and a variable length coding are performed on the reduced estimated error. In this method, it is possible to maintain a high resolution for static background images. Also, it is possible to perform the down-sampling only for motion fields (dynamic image areas) and then to encode reduced motion fields. Thereafter, image information including block division information is transmitted. When the image information of the input image 41 is received at a receiver side, the image information is decoded so as to be a decoded image 44 composed of 352xc3x97288 pixels CIF as shown in FIG. 1.
FIG. 2 is a diagram for briefly explaining ITU-T H.263 Annex P. In FIG. 2, when a picture changes slowly, an input image 51 composed of 352xc3x97288 pixels CIF is divided and encoded at 16xc3x9716 pixels per macroblock to form an image 52 in the same manner as Annex Q. When the picture changes quickly, the input image 51 is reduced so as to be an image 53 composed of 176xc3x97144 pixels QCIF. The image 53 is further divided and encoded at 16xc3x9716 pixels per MB. In this case, the encoded image has a different size from that of the reduced image. Thus, an estimated image is obtained by regenerating the original size. Also, when image information of the input image 51 is received at the receiver side, the image information is decoded based on CIF or QCIF information so as to be a decoded image 54 composed of 352xc3x97288 pixels CIF as shown in FIG. 2.
As mentioned above, when the activity is small, the input image is encoded at a high resolution. On the contrary, when the activity is large, an overload of information is prevented by a division of information into smaller blocks or by reducing the volume of information of the input image. Thus, in order to avoid such an overload of information, the input image is divided by large blocks or the input image is reduced. Thereafter, the input image is encoded at a low resolution.
A block structure and a bit stream structure will be now explained. When the activity is large in a frame (t), the input image is reduced or divided by a large block. An image corresponding to QCIF after being reduced or divided is shown in FIG. 3A. In this case, the input image is divided into 9 rowsxc3x9711 columns of macroblocks. Thereafter, encoded macroblocks on each macroblock line are grouped to compose a GOB (Group Of Blocks). In this example, the divided image has 9 rows. Thus, the divided image is scanned along each row so as to produce 9 block groups of data, GOB0 through GOB8.
In this case, the bit stream structure is composed of PH, GOB0, GOBH, GOB1, GOBH, GOB2, . . . , GOBH and GOB8. It should be noted that the PH means a picture header and the GOBH means a block group header. That is, a picture header PH is added at the beginning of GOB0. Also, block group headers GOBH are added at the beginning of the other block groups of data GOB1 through GOB8.
When the activity is small in a frame (t+1), the input image corresponding to the CIF is divided by a small block. An image corresponding to QCIF after being divided is shown in FIG. 3B. In this case, the input image is divided into 18 rowsxc3x9722 columns of macroblocks. Thereafter, data of encoded macroblocks at a macroblock line is grouped so as to produce 18 block groups of data, GOB0 through GOB17. In this case, the bit stream structure is composed of PH, GOB0, GOBH, GOB1, GOBH, GOB2, . . . , GOBH and GOB17.
The picture header and the block group header will be now explained. FIG. 4A is a diagram showing a picture header PH. The picture header PH includes a synchronous code (Picture Start Code), an image size, a coding mode and so on. FIG. 4B is a diagram showing a block group header GOBH. The GOBH includes a synchronous code (GOB/Slice Start Code) and location information in an image.
FIG. 4C is a diagram showing a bit stream from a sender and FIG. 4D is a diagram showing a bit stream from a receiver. And FIG. 4E is a diagram showing a block group header GOBH which is in conformity to H.263. In FIG. 4E, the block group header GOBH includes the following codes: A GBSC is a unique synchronous code shown as xe2x80x9c0000 0000 0000 0000 1xe2x80x9d. A GN is a block group (GOB) number composed of 5 bits. A GFID is an ID number of the block group GOB. A GQUANT shows a default value for a quantization of this block group GOB. An MBD is a block group of data.
When the receiver normally receives the bit stream from the sender as shown in FIG. 4C, the receiver can recognize all information in the bit stream, including the image size of the picture header PH, the coding mode and so on. Thus, it is possible to successfully decode all information of the bit stream and reproduce one screen composed of a plurality of macroblock lines at the receiver side. Accordingly, an image successfully reproduced is displayed. However, when the receiver can not receive the picture header PH because of an occurrence of a transmission error, it may be impossible for the receiver to get information of the image size, a coding mode and so on. As a result, it is impossible to define the division number of an image that shows how many macroblocks the image is divided into. That is, even if the receiver obtains the image, the receiver can not recognize the number of macroblock lines composing one screen. In this case, it fails to decode and reproduce the image received at the receiver side.
Recently, in wireless mobile communication, it is possible to encod a dynamic image by such as a hybrid encoding method and transmit the encoded dynamic image. In such a mobile communication system that has improved to achive practical use, such as IMT-200, a maximum 2-Mbps transmission is realized. With regard to this transmission performance, it is easily realized to transmit encoded information of a dynamic image to a portable personal computer. However, because a frequency band having a few GHz within wireless frequency bands is used for the wireless mobile communication, there are disadvantages that instability of a wireless transmission path occurs by phasing or the like and also noise occurs easily.
Consequently, such a transmission error as shown in FIGS. 4C and 4D may occur. Accordingly, the transmission error deteriorates remarkably an image quality after an image is encoded and reproduced. For example, FIG. 5A is a diagram showing an image divided by a macroblock before encoding at the sender side. FIG. 5B is a diagram showing an image decoded corresponding to a macroblock at the receiver side. When a frame (t) of a CIF image from the sender is received without any transmission error at the receiver side, the frame (t) is successfully decoded and reproduced.
However, when activity is large in a frame (t+1), the frame (t+1) is divided by a large macroblock or the size of the frame (t+1) is reduced so that a QCIF image is obtained. In this case, when the receiver can not recognize the information of the image size and so on in the picture header PH because of a transmission error, a reduced image as shown as a lower image in FIG. 5B is encoded. That is, at the receiver side, a 32xc3x9732 pixel macro block is recognized as a 16xc3x9716 pixel macro block and decoded as a 16xc3x9716 pixel macro block, or the QCIF image is recognized as a CIF image and decoded as a CIF image. As a result, the received image is decoded without being enlarged. Consequently, such an image shown as the lower image in FIG. 5B is reproduced. Disadvantageously, in this method, a transmission error causes remarkable deterioration of reproduced image quality.
It is a general object of the present invention to provide a dynamic image encoding apparatus and a method for encoding a dynamic image in which resolution and size of an image are properly changed and encoded and the above-mentioned problems are eliminated.
A more specific object of the present invention is to provide a dynamic image encoding apparatus and a method for encoding a dynamic image which are capable of preventing image quality from being deteriorated by decoding and reproducing when a transmission error occurs.
The above objects of the present invention are achieved by a dynamic image encoding apparatus including an encoding part dividing each picture of an input image into a plurality of blocks and encoding each of the blocks into an encoded data block; and a control part determining at least one of a size of the picture and a size of the blocks so as to avoid an occurrence of an overload of information, the control part controlling the encoding part so as to make groups by grouping by a plurality of the encoded data blocks and add a header including a synchronous code at the head of each of the groups to be transmitted, wherein the encoding part inserts block division information indicating one of the size of the picture and the size of the blocks at a position after the synchronous code in the header of each of the groups.
According to the present invention, the block division information is inserted into the header of each of the groups. Therefore, even if the header of the first group can not be recognized at a receiver side because of a transmission error, it is possible to successfully decode the encoded data blocks in the groups when the header of one of the groups is recognized at the receiver side.
The above objects of the present invention are achieved by a method for encoding a dynamic image including the steps of: dividing each picture of an input image into a plurality of blocks and encoding each of the blocks into an encoded data block; determining at least one of a size of the picture and a size of the blocks so as to avoid an occurrence of an overload of information; making groups by grouping by a plurality of the encoded data blocks; adding a header including a synchronous code at the head of each of the groups to be transmitted; and inserting block division information indicating one of the size of the picture and the size of the blocks at a position after the synchronous code in the header of each of the groups.
According to the present invention, the block division information is inserted into the header of each of the groups. Therefore, even if the header of the first group can not be recognized at a receiver side because of a transmission error, it is possible to successfully decode the encoded data blocks in the groups when the header of one of the groups is recognized at the receiver side.